import 'package:flutter/material.dart';
import 'package:lib_ui/lib_ui.dart';
import 'package:plugin_test/plugin_test.dart';

class PluginPage extends StatefulWidget {
  const PluginPage({super.key});

  @override
  State<PluginPage> createState() => _PluginPageState();
}

class _PluginPageState extends State<PluginPage> {
  String name = '';

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) async {
      name = await PluginTest().getName();
      setState(() {});
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TransparentAppBar(title: '测试Flutter插件'),
      body: Center(
        child: Text(name),
      ),
    );
  }
}
